package com.ply.service.impl;

import com.ply.dao.UserDao;
import com.ply.pojo.User;
import com.ply.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> findList() {
        return userDao.findAll();
    }

    @Override
    public void delete(Integer id) {
        userDao.deleteById(id);

    }

    @Override
    public User insert(User user) {
        userDao.save(user);
        return user;
    }

    @Override
    public int update(User user) {
        userDao.save(user);
        return 1;
    }


}
